package com.lixian.mypro;

import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity implements PermissionUtil.PermissionCallBack {
    private static final int P=10001;
    private PermissionUtil instance;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        instance = PermissionUtil.getInstance();
        instance.requestPermissions(this,P,this);
    }
    public void recoder(View view){
        startActivity(new Intent(this,RecoderActivity.class));
    }
    public void mix(View view){
        
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        instance.requestResult(this,permissions,grantResults,this);
    }

    @Override
    public void onPermissionSuccess() {

    }

    @Override
    public void onPermissionReject(String strMessage) {

    }

    @Override
    public void onPermissionFail() {
        finish();
    }
}
